import { service } from '@/utils/axios'

interface LoginParams {
  username: string
  password: string
}

export function loginApi(params: LoginParams): Promise<any> {
  return service({
    // url: '/login',
    url: '/auth/oauth/token',
    method: 'post',
    params
  })
}

export function getUserInfo(): Promise<any> {
  return service({
    // url: '/getUserInfo',
    url: '/system/systemloginauth/findSystemLoginUser',
    method: 'get'
  })
}

export function logoutApi() {
  return service({
    url: '/logout',
    method: 'get'
  })
}

export function getMenuItemList(params: any) {
  return service({
    url: '/system/systemloginauth/findConsoleMenuListAtApplicationAndPark',
    method: 'get',
    params
  })
}

export function getTableList(params: any) {
  return service({
    url: '/table/getTableList',
    method: 'get',
    params
  })
}
